﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderRegister.aspx.cs" Inherits="Truextend.CoffeShop.Layouts.Truextend.CoffeShop.OrderRegister" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">    
    
    <SharePoint:ScriptLink ID="showDailog" runat="server" Name="sp.js" Localizable="false" LoadAfterUI="true" /> 
    <script type="text/javascript">
        function CancelDialog() {
            SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Cancel Clicked');
        }

        function AcceptDialog() {
            SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, 'Se Registro Correctamente');
        }
    </script>

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    
    <asp:Panel ID="RegisterOrderPanel" Visible="true" runat="server">

        <center><h2>Group Order Register</h2></center>

        <center><table>
            <tr>
                <td>
                    <asp:Label ID="LblTitle" runat="server" Text="Title: "></asp:Label> 
                </td>
                
                <td>
                    <asp:TextBox ID="TxBxTitle" runat="server"></asp:TextBox>    
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatorTitle" ControlToValidate="TxBxTitle" 
                    runat="server" ErrorMessage="The Title field is Required"></asp:RequiredFieldValidator>
                    <br />
                    <asp:Panel ID="PanelTitleError" runat="server" Visible="False">                        
                        <asp:Label runat="server" ID="LblTitleError"></asp:Label>
                    </asp:Panel>
                </td>
            </tr>
            
            <tr>
                <td>
                    <asp:Label ID="LblRestaurant" runat="server" Text="Restaurant: "></asp:Label>     
                </td>
                <td>
                    <asp:DropDownList ID="DropDownListRestaurant" runat="server" AutoPostBack="true" 
                    OnSelectedIndexChanged="DropDownListRestaurant_SelectedIndexChanged">                                                                                                                    
                    </asp:DropDownList>     
                    <br />
                    <asp:Panel ID="PanelRestaurantError" runat="server" Visible="False">                        
                        <asp:Label runat="server" ID="LblRestaurantError"></asp:Label>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div runat="server" ID="DivOptions" visible="false">
                        <center><asp:GridView ID="OptionsGridView" runat="server" AutoGenerateColumns="False" 
                        EnableModelValidation="True" DataKeyNames="OptionID">            
                            <Columns>
                                <asp:TemplateField HeaderText="OptionID" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="LblOptionID" runat="server" Text='<%# Bind("OptionID") %>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TxBxOptionID" runat="server" Text='<%# Bind("OptionID") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Product" SortExpression="Description">                
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TxBxDescripion" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="LblDescription" runat="server" Text='<%# Bind("Description") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Price" SortExpression="Price">                
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TxBxPrice" runat="server" Text='<%# Bind("Price") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="LblPrice" runat="server" Text='<%# Bind("Price") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField SortExpression="CheckBoxOption">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBoxOption" runat="server" 
                                            Checked='<%# Bind("CheckBoxOption") %>' Enabled="true" />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:CheckBox ID="CheckBoxOption" runat="server" 
                                            Checked='<%# Bind("CheckBoxOption") %>' />
                                    </EditItemTemplate>
                                </asp:TemplateField>
                            </Columns>        
                        </asp:GridView></center>     
                    </div>      
                    <br />
                    <asp:Panel ID="PanelOptionError" runat="server" Visible="False">                        
                        <asp:Label runat="server" ID="LblOptionError"></asp:Label>
                    </asp:Panel>     
                </td>
            </tr>                       

            <tr>
                <td colspan="2">
                    <asp:CheckBox ID="ChBxDrink" Text="Bebida" runat="server" />    
                </td>
            </tr>

            <tr>
                <td>
                    <asp:Label ID="LblStartDate" runat="server" Text="Start Date: "></asp:Label> 
                </td>
                <td>
                    <SharePoint:DateTimeControl ID="StartDateTime" runat="server" HoursMode24="True" />                    
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="LblEndDate" runat="server" Text="End Date: "></asp:Label> 
                </td>
                <td>
                    <SharePoint:DateTimeControl ID="EndDateTime" runat="server" HoursMode24="True"/>
                    <br />
                    <asp:Panel ID="PanelDatesError" runat="server" Visible="False">                        
                        <asp:Label runat="server" ID="LblDateError"></asp:Label>
                    </asp:Panel>
                </td>
            </tr>
            
            <tr>
                <td>
                    <asp:Label ID="LblDeliveryTime" runat="server" Text="Delivery Time: "></asp:Label>     
                </td>
                <td>
                    <asp:DropDownList ID="DropDownListDeleveryTime" runat="server">
                        <asp:ListItem Text="Choose an option"/>
                        <asp:ListItem Text="10 Min" />
                        <asp:ListItem Text="20 Min" />
                        <asp:ListItem Text="30 Min" />
                        <asp:ListItem Text="40 Min" />
                        <asp:ListItem Text="50 Min" />
                        <asp:ListItem Text="60 Min" />
                    </asp:DropDownList>    
                    <br />
                    <asp:Panel ID="PanelDeleveryTimeError" runat="server" Visible="False">                        
                        <asp:Label runat="server" ID="LblDeleveryTimeError"></asp:Label>
                    </asp:Panel>
                </td>
            </tr>            
            
        </table></center>
        <br />


        <center>
            <asp:Button ID="BtnAccept" OnClick="BtnAccept_Click" runat="server" Text="Create" />
            <asp:Button ID="BtnCancel" OnClientClick="CancelDialog()" runat="server" Text="Cancel" />
        </center>
    </asp:Panel>    

</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    Order Register
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
    Order Register
</asp:Content>
